﻿using EchoWx.Framework.Injector;
using EchoWx.IService;
using EchoWx.Models;
using EchoWx.Models.DtoModel.Identity;
using System.Threading.Tasks;
using System.Web.Http;

namespace EchoWx.Api.Controllers
{
    [RoutePrefix("api/Identity")]
    public class IdentityController : ApiController
    {
        #region + IOC Instance
        private IWxIdentityService _wxIdentityService = DependenceInjector.GetInstance<IWxIdentityService>();
        #endregion
        /// <summary>
        /// 请求授权登录
        /// </summary>
        /// <param name="dto">
        /// AccountLoginDto 类型
        /// </param>
        /// <returns></returns>
        [Route("Login")]
        [HttpPost]
        public async Task<BaseResponse<AccountView>> Login(AccountLoginDto dto)
        {
            return await _wxIdentityService.Login(dto);
        }
    }
}
